VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{B3FB64BF-91F9-11D7-A482-0008A14158BC}#2.22#0"; "ITGControls.ocx"
Begin VB.Form frmSPSupplyIssuance 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Supply Issuance"
   ClientHeight    =   6345
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   10110
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmSPSupplyIssuance.frx":0000
   KeyPreview      =   -1  'True
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   ScaleHeight     =   6345
   ScaleWidth      =   10110
   Begin TabDlg.SSTab SSTab1 
      Height          =   5880
      Left            =   60
      TabIndex        =   9
      Top             =   60
      Width           =   9960
      _ExtentX        =   17568
      _ExtentY        =   10372
      _Version        =   393216
      Tabs            =   2
      TabsPerRow      =   2
      TabHeight       =   520
      TabMaxWidth     =   3528
      TabCaption(0)   =   "Main"
      TabPicture(0)   =   "frmSPSupplyIssuance.frx":0CCA
      Tab(0).ControlEnabled=   -1  'True
      Tab(0).Control(0)=   "Frame1"
      Tab(0).Control(0).Enabled=   0   'False
      Tab(0).ControlCount=   1
      TabCaption(1)   =   "List"
      TabPicture(1)   =   "frmSPSupplyIssuance.frx":0CE6
      Tab(1).ControlEnabled=   0   'False
      Tab(1).Control(0)=   "dtgList"
      Tab(1).ControlCount=   1
      Begin VB.Frame Frame1 
         Height          =   5400
         Left            =   120
         TabIndex        =   10
         Top             =   360
         Width           =   9720
         Begin VB.CommandButton cmdPickPC 
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   2715
            Picture         =   "frmSPSupplyIssuance.frx":0D02
            Style           =   1  'Graphical
            TabIndex        =   5
            Top             =   1710
            Width           =   315
         End
         Begin VB.ComboBox cboDR 
            Height          =   315
            Left            =   4200
            Style           =   2  'Dropdown List
            TabIndex        =   15
            Top             =   4425
            Visible         =   0   'False
            Width           =   1395
         End
         Begin VB.Timer Timer1 
            Interval        =   300
            Left            =   2730
            Top             =   240
         End
         Begin VB.CommandButton cmdPickDelCode 
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   300
            Left            =   2715
            Picture         =   "frmSPSupplyIssuance.frx":0E4C
            Style           =   1  'Graphical
            TabIndex        =   3
            Top             =   1350
            Width           =   315
         End
         Begin ITGControls.ITGTextBox txtDRNo 
            Height          =   285
            Left            =   240
            TabIndex        =   0
            Top             =   240
            Width           =   2445
            _ExtentX        =   4101
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14745599
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "SIF No."
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1250
            TextBoxWidth    =   1135
         End
         Begin ITGControls.ITGTextBox txtDelName 
            Height          =   285
            Left            =   3075
            TabIndex        =   11
            TabStop         =   0   'False
            Top             =   1350
            Width           =   4095
            _ExtentX        =   7117
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14737632
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "ITGtext"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   4035
            Enabled         =   0   'False
         End
         Begin ITGControls.ITGTextBox txtDelCode 
            Height          =   285
            Left            =   225
            TabIndex        =   2
            Top             =   1350
            Width           =   2445
            _ExtentX        =   4101
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "Department"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1250
            TextBoxWidth    =   1135
         End
         Begin ITGControls.ITGTextBox txtRemarks 
            Height          =   285
            Left            =   225
            TabIndex        =   6
            Top             =   2070
            Width           =   6945
            _ExtentX        =   12039
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "Remarks"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1250
            TextBoxWidth    =   5635
         End
         Begin ITGControls.ITGTextBox txtGross 
            Height          =   285
            Left            =   6930
            TabIndex        =   8
            TabStop         =   0   'False
            Top             =   4875
            Width           =   2565
            _ExtentX        =   4313
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14737632
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   "0"
            DataType        =   1
            DecimalPlace    =   2
            Label           =   "Gross"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   990
            TextBoxWidth    =   1515
         End
         Begin MSDataGridLib.DataGrid dtgDR 
            Height          =   1920
            Left            =   255
            TabIndex        =   7
            Top             =   2835
            Width           =   9225
            _ExtentX        =   16272
            _ExtentY        =   3387
            _Version        =   393216
            AllowUpdate     =   -1  'True
            AllowArrows     =   -1  'True
            Appearance      =   0
            BackColor       =   16777215
            HeadLines       =   1
            RowHeight       =   15
            TabAcrossSplits =   -1  'True
            TabAction       =   2
            FormatLocked    =   -1  'True
            AllowDelete     =   -1  'True
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ColumnCount     =   10
            BeginProperty Column00 
               DataField       =   "cRefNo"
               Caption         =   "Reference No."
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column01 
               DataField       =   "cItemNo"
               Caption         =   "Supply ID"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column02 
               DataField       =   "cDesc"
               Caption         =   "Supply Description"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column03 
               DataField       =   "cCosting"
               Caption         =   "Costing"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column04 
               DataField       =   "cUnit"
               Caption         =   "Unit"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column05 
               DataField       =   "nQty"
               Caption         =   "Quantity"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column06 
               DataField       =   "nPrice"
               Caption         =   "Price"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column07 
               DataField       =   "nAmount"
               Caption         =   "Amount"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column08 
               DataField       =   "nCost"
               Caption         =   "Cost"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   1
               EndProperty
            EndProperty
            BeginProperty Column09 
               DataField       =   "nRefIdentity"
               Caption         =   "Reference Identity"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            SplitCount      =   1
            BeginProperty Split0 
               BeginProperty Column00 
                  Locked          =   -1  'True
                  ColumnWidth     =   1094.74
               EndProperty
               BeginProperty Column01 
                  Locked          =   -1  'True
                  ColumnWidth     =   1230.236
               EndProperty
               BeginProperty Column02 
                  Button          =   -1  'True
                  Locked          =   -1  'True
                  ColumnWidth     =   2204.788
               EndProperty
               BeginProperty Column03 
                  Locked          =   -1  'True
                  Object.Visible         =   0   'False
                  ColumnWidth     =   854.929
               EndProperty
               BeginProperty Column04 
                  Locked          =   -1  'True
                  ColumnWidth     =   750.047
               EndProperty
               BeginProperty Column05 
                  Alignment       =   1
                  ColumnWidth     =   959.811
               EndProperty
               BeginProperty Column06 
                  Alignment       =   1
                  Locked          =   -1  'True
                  ColumnWidth     =   1080
               EndProperty
               BeginProperty Column07 
                  Alignment       =   1
                  Locked          =   -1  'True
                  Object.Visible         =   -1  'True
                  ColumnWidth     =   1409.953
               EndProperty
               BeginProperty Column08 
                  Alignment       =   1
                  Locked          =   -1  'True
                  Object.Visible         =   0   'False
               EndProperty
               BeginProperty Column09 
                  Locked          =   -1  'True
                  Object.Visible         =   0   'False
               EndProperty
            EndProperty
         End
         Begin ITGControls.ITGDateBox dtbDate 
            Height          =   285
            Left            =   5865
            TabIndex        =   1
            Tag             =   "Delivery Date"
            Top             =   240
            Width           =   1320
            _ExtentX        =   2328
            _ExtentY        =   503
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   ""
            SendKeysTab     =   -1  'True
            Mandatory       =   -1  'True
         End
         Begin ITGControls.ITGLabel ITGLabel4 
            Height          =   285
            Left            =   5250
            TabIndex        =   12
            Top             =   240
            Width           =   495
            _ExtentX        =   873
            _ExtentY        =   503
            Caption         =   "Date"
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
         End
         Begin ITGControls.ITGTextBox txtPCDesc 
            Height          =   285
            Left            =   3075
            TabIndex        =   18
            TabStop         =   0   'False
            Top             =   1710
            Width           =   4095
            _ExtentX        =   7117
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   14737632
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "ITGtext"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   4035
            Enabled         =   0   'False
         End
         Begin ITGControls.ITGTextBox txtPCCode 
            Height          =   285
            Left            =   225
            TabIndex        =   4
            Top             =   1710
            Width           =   2445
            _ExtentX        =   4101
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "Account"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1250
            TextBoxWidth    =   1135
         End
         Begin ITGControls.ITGTextBox ITGTextBox1 
            Height          =   285
            Left            =   225
            TabIndex        =   19
            Top             =   975
            Width           =   6945
            _ExtentX        =   12039
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "Attention"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1250
            TextBoxWidth    =   5635
         End
         Begin VB.Line Line2 
            BorderColor     =   &H00000000&
            X1              =   765
            X2              =   9240
            Y1              =   2595
            Y2              =   2595
         End
         Begin VB.Label Label4 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "Details"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   2
            Left            =   120
            TabIndex        =   16
            Top             =   2475
            Width           =   585
         End
         Begin VB.Label Label4 
            AutoSize        =   -1  'True
            BackStyle       =   0  'Transparent
            Caption         =   "Issuance Information"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   195
            Index           =   0
            Left            =   120
            TabIndex        =   13
            Top             =   645
            Width           =   1830
         End
         Begin VB.Line Line1 
            BorderColor     =   &H00000000&
            X1              =   1980
            X2              =   9225
            Y1              =   765
            Y2              =   765
         End
      End
      Begin MSDataGridLib.DataGrid dtgList 
         Height          =   5325
         Left            =   -74880
         TabIndex        =   14
         Top             =   435
         Width           =   8880
         _ExtentX        =   15663
         _ExtentY        =   9393
         _Version        =   393216
         AllowUpdate     =   0   'False
         AllowArrows     =   -1  'True
         Appearance      =   0
         HeadLines       =   1
         RowHeight       =   15
         TabAction       =   2
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   7
         BeginProperty Column00 
            DataField       =   "cDRNo"
            Caption         =   "Receipt No."
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "cDelCode"
            Caption         =   "Client ID"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "dDate"
            Caption         =   "Date"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "MM/dd/yyyy"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   3
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "cType"
            Caption         =   "Type"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column04 
            DataField       =   "dReceived"
            Caption         =   "Received Date"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "MM/dd/yyyy"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   3
            EndProperty
         EndProperty
         BeginProperty Column05 
            DataField       =   "dReturned"
            Caption         =   "Returned Date"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "MM/dd/yyyy"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   3
            EndProperty
         EndProperty
         BeginProperty Column06 
            DataField       =   "cRemarks"
            Caption         =   "Remarks"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            AllowRowSizing  =   0   'False
            BeginProperty Column00 
               ColumnAllowSizing=   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   1544.882
            EndProperty
            BeginProperty Column01 
               Locked          =   -1  'True
               ColumnWidth     =   1395.213
            EndProperty
            BeginProperty Column02 
               Locked          =   -1  'True
               ColumnWidth     =   1335.118
            EndProperty
            BeginProperty Column03 
               Locked          =   -1  'True
               ColumnWidth     =   1544.882
            EndProperty
            BeginProperty Column04 
               Locked          =   -1  'True
               ColumnWidth     =   1395.213
            EndProperty
            BeginProperty Column05 
               Locked          =   -1  'True
               ColumnWidth     =   1425.26
            EndProperty
            BeginProperty Column06 
               Locked          =   -1  'True
               ColumnWidth     =   2520
            EndProperty
         EndProperty
      End
   End
   Begin MSComctlLib.StatusBar sbRS 
      Align           =   2  'Align Bottom
      Height          =   285
      Left            =   0
      TabIndex        =   17
      Top             =   6060
      Width           =   10110
      _ExtentX        =   17833
      _ExtentY        =   503
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   5
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Bevel           =   0
            Object.Width           =   4606
            MinWidth        =   2
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "frmSPSupplyIssuance"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''logicglass inc. 2003.08.04
'
'Option Explicit
'
''Object variables
'
'
'
'
'Private oPrint As New clsPrinting
'
''Recordset variables
'Private WithEvents rsHeader As ADODB.Recordset
'Private rsDetail As ADODB.Recordset
'
''ADO Connection variables
'
'Private connHeader As ADODB.Connection
'Private connDetail As ADODB.Connection
'
''Form mode enumeration
'Enum eDRMode
'    Normal
'    AddNewEdit
'    Find
'End Enum
'Public Mode As eDRMode
'
''Other declarations
'Public dtgName As String
'Public sBit As String
'Public lSystemGeneratedDR As Boolean, lChangedTranNo As Boolean
'Private vBM As Variant 'Recordset bookmark variable
'Public strNo As String, X As String, sType As String
'
'Private nLimit, nAR, nARPastDue, nPDC, nHold, nBounced, nSOAmtLeft, nLimitBalance As Double 'For credit limit purposes
'Private lOverride As Boolean
'
''Security Acess Level variables
'Public lACNew As Boolean
'Public lACEdit As Boolean
'Public lACDelete As Boolean
'Public lACPost As Boolean
'Public lACCancel As Boolean
'Public lACPrint As Boolean
'
'Private Sub cboDocType_Click()
''    txtDocType = Trim(cboDocType)
'On Error GoTo TheSource
'    txtDocType = Trim(cboDocType)
'    If Mode <> AddNewEdit Then Exit Sub
'    If Trim(txtDRNo) = "" Then Exit Sub
'    If rsHeader.Status <> adRecNew Then
'        If ((Format(Right(txtDRNo, 5) - 1, X))) <> (strNo) Then Exit Sub
'    End If
'    GetCtrlNo
'TheSource:
'    Exit Sub
'End Sub
'
'Private Sub cboDocType_KeyPress(KeyAscii As Integer)
'    SendKeysTab KeyAscii
'End Sub
'
'Private Sub cboDR_Click()
'    If dtgDR.Col = 4 Then
'        rsDetail!cWH = cboDR
'    End If
'End Sub
'
'Private Sub cboDR_KeyDown(KeyCode As Integer, Shift As Integer)
'    If KeyCode = 13 Then
'        If dtgDR.Col = 4 Then
'            rsDetail!cWH = cboDR
'            cboDR.Visible = False
'            dtgDR.Col = 6
'            dtgDR.SetFocus
'        End If
'    ElseIf KeyCode = vbKeyEscape Then
'        cboDR.Visible = False
'    End If
'End Sub
'
'Private Sub cboDR_LostFocus()
'    cboDR.Visible = False
'End Sub
'
'Private Sub cboType_Click()
'    If Trim(cboType) = "Project" Then
'        txtProjNo.Visible = True
'        txtProjNo.TabStop = True
'        cmdPickProjNo.Visible = True
'        cmdPickProjNo.TabStop = True
'        EditDetail_Others False
'    ElseIf Trim(cboType) = "Purchase Return" Then
'        txtProjNo.Visible = False
'        txtProjNo.TabStop = False
'        cmdPickProjNo.Visible = False
'        cmdPickProjNo.TabStop = False
'        EditDetail_Others True
'    ElseIf Trim(cboType) = "Others" Then
'        txtProjNo.Visible = False
'        txtProjNo.TabStop = False
'        cmdPickProjNo.Visible = False
'        cmdPickProjNo.TabStop = False
'        EditDetail_Others True
'    Else
'        txtProjNo.Visible = False
'        txtProjNo.TabStop = False
'        cmdPickProjNo.Visible = False
'        cmdPickProjNo.TabStop = False
'        EditDetail_Others False
'    End If
'    txtType = Trim(cboType)
'    If Mode <> AddNewEdit Then Exit Sub
'    If rsDetail.RecordCount <> 0 Then
'        rsDetail.MoveFirst
'        Do Until rsDetail.EOF
'            rsDetail.Delete
'            rsDetail.MoveNext
'        Loop
'    End If
'    EditDetail True
'End Sub
'
'Sub EditDetail_Others(bval As Boolean)
'    dtgDR.Columns(1).Locked = Not bval
'    dtgDR.Columns(1).Button = bval
'End Sub
'
'Private Sub cboType_KeyPress(KeyAscii As Integer)
'    SendKeysTab KeyAscii
'End Sub
'
'Private Sub cmdLoad_Click()
'
'    If Mode <> AddNewEdit Then Exit Sub
'
'    If Trim(cboType) = "" Then
'        MsgBox "Please select transaction type.", vbInformation, "ComUnion"
'        cboType.SetFocus
'        Exit Sub
'    End If
'
'    If Trim(txtDelCode) = "" Then
'        Select Case UCase(Trim(cboType))
'            Case "PRODUCTION-OS"
'            Case "PRODUCTION-INT"
'            Case Else
'                MsgBox "Please input Supplier id.", vbInformation, "ComUnion"
'                txtDelCode.SetFocus
'                Exit Sub
'        End Select
'    End If
'
'    If Trim(txtProjNo) = "" Then
'        Select Case UCase(Trim(cboType))
'            Case "PROJECT"
'                MsgBox "Please input Project Number.", vbInformation, "ComUnion"
'                txtProjNo.SetFocus
'                Exit Sub
'        End Select
'    End If
'
'    RepName = Trim(txtDelCode)
'
'    'Reference Type
'    Select Case UCase(Trim(cboType))
'        Case "ISSUES"
'            frmARDRList.mDRType = SO
'        Case "SALES"
'            frmARDRList.mDRType = SO
'        Case "SAMPLE"
'            frmARDRList.mDRType = Sample
'        Case "DEMO"
'            frmARDRList.mDRType = Demo
'        Case "PRODUCTION-OS"
'            frmARDRList.mDRType = Production
'        Case "PRODUCTION-INT"
'            frmARDRList.mDRType = Production
'        Case "REPLACEMENT"
'            frmARDRList.mDRType = Replacement
'        Case "TRANSFER"
'            frmARDRList.mDRType = Transfer
'        Case "CONSIGNMENT"
'            frmARDRList.mDRType = Consignment
'        Case "PURCHASE RETURN"
'            frmARDRList.mDRType = ReturnPurchase
'        Case "PROJECT"
'            cString = Trim(txtProjNo)
'            frmARDRList.mDRType = Project_Items
'        Case "OTHERS"
'            frmARDRList.mDRType = Others
'    End Select
'
'    If Not frmARDRList.Visible Then frmARDRList.Show vbModal
'
'End Sub
'
'Private Sub cmdPickDelCode_Click()
'    If lPickListActive Then Exit Sub
'    sFilterString = Trim(txtDelCode)
'    If Trim(cboType) = "Purchase Return" Then
'        frmITGPickList.mType = Client_Supplier
'    ElseIf Trim(cboType) = "Production-OS" Then
'        frmITGPickList.mType = Client_Supplier
'    ElseIf Trim(cboType) = "Production-Int" Then
'        frmITGPickList.mType = Client_Supplier
'    ElseIf Trim(cboType) = "Transfer" Then
'        frmITGPickList.mType = Client_All
'    Else
'        frmITGPickList.mType = Client_Customer
'    End If
'    frmITGPickList.Show vbModal
'    txtDelCode = frmITGPickList.mCode
'    If Trim(txtDelName) <> "" Then SendKeys "{Tab}"
'End Sub
'
'Private Sub cmdPickPC_Click()
'    If lPickListActive Then Exit Sub
'    frmITGPickList.mType = ProfitCenter
'    frmITGPickList.Show vbModal
'    rsHeader!cPCCode = frmITGPickList.mCode
'    txtPCCode = frmITGPickList.mCode
'    If Trim(txtPCDesc) <> "" Then SendKeys "{Tab}"
'End Sub
'
'Private Sub cmdPickProjNo_Click()
'    If lPickListActive Then Exit Sub
'    RepName = Trim(txtDelCode)
'    frmITGPickList.mType = Project
'    frmITGPickList.Show vbModal
'    txtProjNo = frmITGPickList.mCode
'    If Trim(txtProjNo) <> "" Then SendKeys "{Tab}"
'End Sub
'
'Private Sub dtbReturned_LostFocus()
'    If Mode <> AddNewEdit Then Exit Sub
'    If rsDetail.RecordCount = 0 Then TBNewLine
'End Sub
'
'Private Sub dtgDR_AfterColUpdate(ByVal ColIndex As Integer)
'    If Mode <> AddNewEdit Then Exit Sub
'    Select Case ColIndex
'        Case 1
'            If GetValueFrTable("cItemNo", "ITEM", "cItemNo = '" & Trim(dtgDR.Columns(1).Value) & "'") <> "" Then
'                GetInitialItemValues rsDetail
'                dtgDR.Col = 6
'                dtgDR.Columns(6).Value = IIf(IsNull(rsDetail!nQty), 0, rsDetail!nQty)
'            End If
'        Case 6
'            ComputeAmount
'            ComputeTotal
'        Case 7
'            ComputeAmount
'            ComputeTotal
'    End Select
'
'End Sub
'
'Private Sub dtgDR_ButtonClick(ByVal ColIndex As Integer)
'
'    If ColIndex = 2 Then
'        Call MoveText(txtLongDesc, dtgDR, dtgDR.Columns(2))
'        txtLongDesc = rsDetail!cLongDesc & ""
'    End If
'    If Mode <> AddNewEdit Then Exit Sub
'    Select Case ColIndex
'        Case 1
'            Select Case Trim(cboType)
'                Case "Purchase Return"
'                    If lPickListActive Then Exit Sub
'                    sFilterString = Trim(dtgDR.Columns(1).Text)
'                    frmITGPickList.mType = Product
'                    frmITGPickList.Show vbModal
'                    rsDetail!cItemNo = Trim(frmITGPickList.mCode) & ""
'                    If (Trim(frmITGPickList.mName) & "") <> "" Then
'                        GetInitialItemValues rsDetail
'                        dtgDR.Col = 6
'                        dtgDR.Columns(6).Value = 0
'                    End If
'                Case "Others"
'                    If lPickListActive Then Exit Sub
'                    sFilterString = Trim(dtgDR.Columns(1).Text)
'                    frmITGPickList.mType = Product
'                    frmITGPickList.Show vbModal
'                    rsDetail!cItemNo = Trim(frmITGPickList.mCode) & ""
'                    If (Trim(frmITGPickList.mName) & "") <> "" Then
'                        GetInitialItemValues rsDetail
'                        dtgDR.Col = 6
'                        dtgDR.Columns(6).Value = 0
'                    End If
'                Case Else
'                    Exit Sub
'            End Select
'        Case 4
'            Call LoadComboValues(cboDR, "cWH", "WHSE", "WHERE cCompanyID = '" & COID & "'")
'            Call MoveCombo(cboDR, dtgDR, dtgDR.Columns(4))
'            ComboLoadValue cboDR, Trim(dtgDR.Columns(4).Text)
'        Case 9
'            RepName = Trim(dtgDR.Columns(1).Text)
'            frmFindBatch.mBatchPick = Batch_Lot
'            frmFindBatch.Show vbModal
'            dtgDR.Columns(9).Value = frmFindBatch.mBatchID
'    End Select
'
'End Sub
'
''Set the datagrid as active control
'Private Sub dtgDR_Click()
'    If Mode = AddNewEdit Then dtgName = dtgDR.Name
'End Sub
'
'Private Sub dtgDR_Error(ByVal DataError As Integer, Response As Integer)
'    Response = 0
'End Sub
'
'Private Sub dtgDR_GotFocus()
'    dtgName = dtgDR.Name
'End Sub
'
'Private Sub dtgDR_KeyDown(KeyCode As Integer, Shift As Integer)
'    If Mode <> AddNewEdit Then Exit Sub
'    If (Shift = vbCtrlMask And KeyCode = 45) Then
'        TBNewLine
'    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
'        TBDeleteLine
'    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
'        TBSave
'    End If
'End Sub
'
'Private Sub dtgDR_KeyPress(KeyAscii As Integer)
'
'    If Mode <> AddNewEdit Then Exit Sub
'    If rsDetail.RecordCount = 0 Then Exit Sub
'
'    If KeyAscii = 39 Then KeyAscii = 0 'Apostrophe {'}
'
'    If KeyAscii = 13 Then
'        Select Case dtgDR.Col
'            Case 1
'                If GetValueFrTable("cItemNo", "ITEM", "cItemNo = '" & Trim(dtgDR.Columns(1).Value) & "'") = "" Then
'                    dtgDR_ButtonClick (1) 'use button click
'                End If
'            Case 6
'                Select Case Trim(cboType)
'                    Case "Others"
'                        rsDetail!nQty = dtgDR.Columns(6).Value
'                        dtgDR_AfterColUpdate (6)
'                        TBNewLine
'                        dtgDR.LeftCol = 0
'                    Case Else
'                        rsDetail!nQty = dtgDR.Columns(6).Value
'                        dtgDR_AfterColUpdate (6)
'                        dtgDR.Col = 9
'                        dtgDR.Columns(9).Value = rsDetail!cBatchID
'                End Select
''            Case 6
''                rsDetail!nQty = dtgDR.Columns(6).Value
''                dtgDR_AfterColUpdate (6)
''                dtgDR.Col = 9
''                dtgDR.Columns(9).Value = rsDetail!cBatchID
'            Case Else
'                SendKeys "{Tab}"
'        End Select
'    Else
'        KeyAscii = Asc(UCase(Chr(KeyAscii))) 'All Upper Case String
'    End If
'
'End Sub
'
''Right click menu popup
'Private Sub dtgDR_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
'    If Mode <> AddNewEdit Then Exit Sub
'    If Button = 2 Then
'        dtgName = dtgDR.Name
'        PopupMenu ITGLedgerMain.mnuDetail
'    End If
'End Sub
'
'Private Sub dtgList_HeadClick(ByVal ColIndex As Integer)
'    SortGrid dtgList, ColIndex, rsHeader
'End Sub
'
''Set Your Object
'Private Sub Form_Load()
'
'    AcessBit Me, GetValueFrTable("AccessLevel", "SEC_ACCESSLEVEL", "RoleID = '" & SecUserRole & "' AND [Module] = 'MI01'")
'
'    Set rsHeader = New ADODB.Recordset
'    Set rsDetail = New ADODB.Recordset
'
'
'    'Load combobox values
'    Call LoadComboValues(cboDocType, "cValue", "PARAMETER_USER", "WHERE cType = 'DRDOCTYPE' AND cCompanyID = '" & Trim(COID) & "'")
'
'    Set FrmName = Me
'    FormLocking True
'    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
'    BitVisible ITGLedgerMain.tbrMain, True, True
'    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
'
'    'System generated so number
'    'lSystemGeneratedSO = GetValueFrTable("lBit", "SYSTEM_OPTION", "cCode = 'OTHERS_AUTOTRANNO_SO' ")
'    lSystemGeneratedDR = True
'
'    Mode = Find
'    txtDRNo.Locked = False
'End Sub
'
''Activate your Toolbar Mode
'Private Sub Form_Activate()
'    TBBitReload
'End Sub
'
''Release your Object
'Private Sub Form_Unload(Cancel As Integer)
'On Error Resume Next
'    If Mode = AddNewEdit Then
'        MsgBox "Unable to close. You are in Add/New/Edit mode." & vbCr & _
'            " Must Save or Undo", vbCritical, Me.Caption
'        Cancel = True
'        Exit Sub
'    End If
'
'    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , , , , , True
'    BitVisible ITGLedgerMain.tbrMain
'    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = False
'
'
'
'
'
'    Set oPrint = Nothing
'    Set rsHeader = Nothing
'    Set rsDetail = Nothing
'    Set connHeader = Nothing
'    Set connDetail = Nothing
'
'    Set frmARDeliveryReceipt = Nothing
'
'    lCloseWindow = True
'End Sub
'
''Add new record to the recordset
'Public Sub TBNew()
'
'    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
'    txtDRNo.BackColor = &HE0FFFF
'    Mode = AddNewEdit
'
'    If rsHeader.State <> adStateOpen Then
'        OpenNewConnection connHeader
'        OpenNewConnection connDetail
'        OpenRecordsetWithCN rsDetail, "*", "DR_T", connDetail, "WHERE 1 = 0"
'        OpenRecordsetWithCN rsHeader, "*", "DR", connHeader, "WHERE 1 = 0"
'        SetDataSource
'        SetDataField
'    Else
'        vBM = rsHeader.Bookmark
'    End If
'
'    rsHeader.AddNew
'    rsHeader!cCompanyID = COID
'    rsHeader!dDate = Date
'    rsHeader!cType = "Issues"
'    cboDocType.ListIndex = 0
'
'    Set FrmName = Me
'    FormLocking False
'    txtGross.Locked = True
'    SSTab1.Tab = 0
'    txtDRNo.SetFocus
'
'    'system generated so no
'    If lSystemGeneratedDR Then GetCtrlNo
'    '--------------------------
'
'End Sub
'
''Undo all changes to the recordset
'Public Sub TBUndoAll()
'On Error GoTo ErrorHandler
'
'    Mode = Normal
'
'    If rsHeader.Status = adRecNew Then TBUndoCurrent
'
'    rsHeader.CancelBatch adAffectAll
'    rsDetail.CancelBatch adAffectAll
'
'    UnbindControls
'
'    If rsHeader.RecordCount <> 0 Then rsHeader.Bookmark = vBM
'
'    Set FrmName = Me
'    FormLocking True
'
'    If rsHeader.RecordCount <> 0 Then
'        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , lACCancel, , , True, True, lACPrint, True, True
'    Else
'        RSZero
'        Mode = Find
'    End If
'
'    sbRS.Panels(2) = ""
'
'    SetDataSource
'    SetDataField
'
'    EditDetail False
'
'ErrorHandler:
'
'    cboDR.Visible = False
'
'    If Err.Number = -2147217885 Then
'        Resume Next
'    ElseIf Err.Number = -2147217842 Then 'Operation was cancelled. (Error returned by ITGDateBox)
'        TBUndoAll
'    End If
'
'End Sub
'
''Undo changes on the current record
'Public Sub TBUndoCurrent()
'On Error GoTo ErrorHandler
'
'    GetChild
'    If rsHeader.Status = adRecNew Then
'        rsDetail.CancelBatch adAffectAll
'        rsHeader.CancelUpdate
'    Else
'        rsHeader.CancelBatch adAffectCurrent
'        rsDetail.CancelBatch adAffectAll
'    End If
'
'    If rsHeader.RecordCount = 0 Then RSZero
'
'ErrorHandler:
'    If Err.Number = -2147217885 Then
'        Resume Next
'    ElseIf Err.Number = -2147217842 Then 'Operation was cancelled. (Error returned by ITGDateBox)
'        TBUndoCurrent
'    End If
'
'End Sub
'
''Save all changes
'Public Sub TBSave()
'Dim OKUpdate As Boolean
'Dim lNew As Boolean
'On Error GoTo ErrHandler
'
'    'Audit Trail
'    lBoolean = False
'
'    If rsHeader.Status = adRecNew Then
'        lBoolean = True
'        If GetValueFrTable("lBit", "SYSTEM_OPTION", "cCode = 'CL_CHECKING_DR'") Then
'            If Not lOverride Then
'                If (UCase(Trim(cboType)) = "ISSUES") Or (UCase(Trim(cboType)) = "SALES") Then
'                    If CDbl(txtGross) > (nLimitBalance) Then
'                        MsgBox "DR Gross exceeds the allowable credit limit balance." & vbCr & _
'                                "Transaction cannot be saved.", vbInformation, "ComUnion"
'                        Exit Sub
'                    End If
'                End If
'            End If
'        End If
'        If Not BalancePerWarehouseOK Then Exit Sub
'    End If
'
'    If Not MandatoryOK Then Exit Sub
'
'    'System generated dr no
'    If rsHeader.Status = adRecNew Then
'        If GetValueFrTable("lFormat", "PARAMETER_USER", "cValue = '" & Trim(cboDocType) & "' AND cType = 'DRDOCTYPE' ") = True Then
'            If Not CheckCtrlNo Then Exit Sub
'        End If
'        lNew = True
'    End If
'    '----------------------
'
'    OKUpdate = False
'    cn.BeginTrans
'    connHeader.BeginTrans
'    connDetail.BeginTrans
'
'    rsHeader.UpdateBatch adAffectAll
'    rsDetail.UpdateBatch adAffectAll
'
'    If UCase(Trim(cboType)) = "SALES" Then
'        If Not DRSales Then GoTo ErrHandler
'    End If
'
'    cn.CommitTrans
'    connHeader.CommitTrans
'    connDetail.CommitTrans
'    OKUpdate = True
'
'    Set FrmName = Me
'    FormLocking True
'    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , lACCancel, , , True, True, lACPrint, True
'    Mode = Normal
'
'    MsgBox "Record/s successfully saved.", vbInformation, "ComUnion"
'    sbRS.Panels(2) = ""
'
'    If UCase(Trim(cboType)) = "PRODUCTION-INT" Then Update_Prod_RefNo Trim(txtDRNo)
'    If UCase(Trim(cboType)) = "PRODUCTION-OS" Then Update_Prod_RefNo Trim(txtDRNo)
'
'    'Audit trail
'    UpdateLogFile "Delivery Receipt", Trim(txtDRNo), IIf(lBoolean, "Inserted", "Updated")
'
'    'Update GL Activity
'    UpdateGLA "Update", "DR", Trim(txtDRNo)
'
'    'System generated dr no
'    If lNew = True Then
'        If lSystemGeneratedDR = True Then UpdateCtrlNo
'    End If
'    '----------------------
'
'ErrHandler:
'
'    cboDR.Visible = False
'
'    If Err.Number = -2147217885 Then
'        Resume Next
'    ElseIf Err.Number = -2147217864 Then
'        OKUpdate = True
'        cn.RollbackTrans
'        connHeader.RollbackTrans
'        connDetail.RollbackTrans
'        MsgBox "Record cannot be updated. Some values may have been changed by other user/s since last read." & vbCr & _
'                "Records will be automatically refreshed. All changes made to the record will be gone upon refresh.", vbInformation, "ComUnion"
'        vBookMark = rsHeader.Bookmark
'        UnbindControls
'        rsHeader.Requery
'        rsDetail.Requery
'        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , lACCancel, , , True, True, lACPrint, True
'        Mode = Normal
'        If rsHeader.RecordCount <> 0 Then
'            Set FrmName = Me
'            FormLocking True
'            SetDataField
'            SetDataSource
'            rsHeader.Bookmark = vBookMark
'        Else
'            RSZero
'        End If
'    End If
'    If Not OKUpdate Then
'        MsgBox "Transaction update failed.", vbInformation, "ComUnion"
'        cn.RollbackTrans
'        connHeader.RollbackTrans
'        connDetail.RollbackTrans
'        ErrorLog Err.Number, Err.Description, Me.Name 'Error log
'    End If
'
'End Sub
'
''Sets the form & recorset to add/edit mode
'Public Sub TBEdit()
'    If rsHeader!lCancelled = True Then
'        MsgBox "Transaction was already cancelled. Edit is not allowed.", vbExclamation, "ComUnion"
'        Exit Sub
'    End If
'    If Not AllowEdit Then Exit Sub
'    Mode = AddNewEdit
'    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
'    Set FrmName = Me
'    FormLocking False
'    txtGross.Locked = True
'    txtDRNo.Locked = True
'    SSTab1.Tab = 0
'    dtbDate.SetFocus
'    vBM = rsHeader.Bookmark
'End Sub
'
''Delete record
'Public Sub TBDelete()
'On Error GoTo ErrorHandler
'
'    sID = Trim(txtDRNo)
'
'    If rsHeader.RecordCount = 0 Then Exit Sub
'
'    If rsHeader!lCancelled = True Then
'        MsgBox "Transaction was already cancelled. Deletion is not allowed.", vbExclamation, "ComUnion"
'        Exit Sub
'    End If
'
'    If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, "ComUnion") = vbNo Then Exit Sub
'
'    If Not AllowDelete("delete") Then Exit Sub
'
'    'Update GL Activity
'    UpdateGLA "Delete", "DR", Trim(txtDRNo)
'
'    GetChild
'    If rsDetail.RecordCount <> 0 Then
'        rsDetail.MoveFirst
'        Do Until rsDetail.RecordCount = 0
'            rsDetail.Delete adAffectCurrent
'            If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
'        Loop
'    End If
'
'    'Audit trail
'    UpdateLogFile "Delivery Receipt", Trim(txtDRNo), "Deleted"
'
'    rsHeader.Delete adAffectCurrent
'
'    rsDetail.UpdateBatch adAffectAll
'    rsHeader.UpdateBatch adAffectAll
'
'    TBPrevRec
'
'    Mode = Normal
'
'    If rsHeader.RecordCount = 0 Then
'        RSZero
'    End If
'
'ErrorHandler:
'    If Err.Number = -2147217885 Then
'        Resume Next
'    ElseIf Err.Number = -2147217864 Then
'        cn.Execute "DELETE DR_T WHERE cDRNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
'        cn.Execute "DELETE DR WHERE cDRNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
'        Resume Next
'    End If
'
'End Sub
'
''Search using the frmITGSearch
'Public Sub TBFind()
'    Mode = Normal
'    txtDRNo.Locked = True
'    frmITGSearch.Show 'vbModal
'End Sub
'
''Search using the recordset primary key
'Public Sub TBFindPrimary()
'    RSZero
'    Mode = Find
'End Sub
'
'Public Sub TBAccountAffected()
'    RepName = "DR"
'    frmAccountAffected.mModuleType = KDR
'    frmAccountAffected.mRefPK = txtDRNo.Text
'    frmAccountAffected.Show vbModal
'End Sub
'
''Reload menu buttons (do not delete this sub)
'Public Sub TBBitReload()
'    BitVisible ITGLedgerMain.tbrMain, True, True
'    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
'    BitReload ITGLedgerMain, Me, ITGLedgerMain.tbrMain, sBit
'    Set FrmName = Me
'    dtgName = dtgDR.Name
'End Sub
'
''Close active window
'Public Sub TBCloseWindow()
'    Unload Me
'End Sub
'
''Move first
'Public Sub TBFirstRec()
'    If rsHeader.State <> adStateOpen Then Exit Sub
'    MoveFirst rsHeader
'End Sub
'
''Move previuos
'Public Sub TBPrevRec()
'    If rsHeader.State <> adStateOpen Then Exit Sub
'    MovePrevious rsHeader
'End Sub
'
''Move next
'Public Sub TBNextRec()
'    If rsHeader.State <> adStateOpen Then Exit Sub
'    MoveNext rsHeader
'End Sub
'
''Move last
'Public Sub TBLastRec()
'    If rsHeader.State <> adStateOpen Then Exit Sub
'    MoveLast rsHeader
'End Sub
'
''Add new line to the detail recordset
'Public Sub TBNewLine()
'    If Trim(cboType) = "" Then
'        MsgBox "Please select transaction type.", vbExclamation, "ComUnion"
'        Exit Sub
'    Else
'        If (Trim(cboType) = "Others") Then
'            If rsHeader!cdrno = "" Then Exit Sub
'
'            If dtgName = "dtgDR" Then
'                rsDetail.AddNew
'                rsDetail!cCompanyID = COID
'                rsDetail!cdrno = Trim(rsHeader!cdrno)
'                dtgDR.Col = 1
'                dtgDR.Columns(1).Value = ""
'                GetChild
'                If rsDetail.RecordCount <> 0 Then rsDetail.MoveLast
'                dtgDR.SetFocus
'            End If
'        Else
'            cmdLoad_Click 'Load details from list
'        End If
'    End If
'
'    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
'End Sub
'
''Delete line in the detail recordset
'Public Sub TBDeleteLine()
'On Error GoTo ErrorHandler
'
'    If dtgName = dtgDR.Name Then
'        If rsDetail.RecordCount = 0 Then Exit Sub
'        vBookMark = dtgDR.Bookmark
'        GetChild
'        dtgDR.Bookmark = vBookMark
'        rsDetail.Delete adAffectCurrent
'        ComputeTotal
'    End If
'    GetChild
'
'    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
'
'ErrorHandler:
'    If Err.Number = -2147217885 Then
'        Resume Next
'    End If
'
'End Sub
'
''Undo All
'Public Sub TBUndoLineAll()
'On Error GoTo ErrorHandler
'
'    MsgBox "Unavailable on " & Me.Name
'
'ErrorHandler:
'    If Err.Number = -2147217885 Then
'        Resume Next
'    End If
'
'End Sub
'
''Undo current line
'Public Sub TBUndoLineCurrent()
'    MsgBox "Unavailable on " & Me.Name
'End Sub
'
''Post current record
'Public Sub TBPostRecord()
'    MsgBox "Unavailable on " & Me.Name
'End Sub
'
''Cancel current record
'Public Sub TBCancelRecord()
'On Error GoTo ErrorHandler
'
'    If rsHeader.RecordCount = 0 Then Exit Sub
'
'    If rsHeader!lCancelled = True Then
'        MsgBox "Transaction was already cancelled.", vbExclamation, "ComUnion"
'        Exit Sub
'    End If
'
'    If MsgBox("Are you sure you want to cancel this record?", vbQuestion + vbYesNo, "ComUnion") = vbNo Then Exit Sub
'
'    If Not AllowDelete("cancel") Then Exit Sub
'
'    'Audit trail
'    UpdateLogFile "Delivery Receipt", Trim(txtDRNo), "Cancelled"
'
'    cn.Execute ("UPDATE DR SET lCancelled = 1 WHERE cDRNo = '" & Trim(txtDRNo) & "' AND cCompanyID = '" & COID & "'")
'
'    sbRS.Panels(5) = "CANCELLED"
'    Mode = Normal
'
'    rsHeader!lCancelled = True
'    rsHeader.UpdateBatch adAffectAll
'
'ErrorHandler:
'    If Err.Number = -2147217885 Then
'        Resume Next
'    End If
'
'End Sub
'
''Print
'Public Sub TBPrintRecord()
'    If Trim(txtDRNo) = "" Then Exit Sub
'    RepName = GetValueFrTable("cParamName", "PARAMETER_USER", "cType = 'DRDOCTYPE' AND cValue = '" & Trim(cboDocType) & "'")
'    cModule = "Delivery_Receipt"
'    oPrint.PrintReceipt Trim(txtDRNo)
'End Sub
'
''Sets the data source of the controls
'Sub SetDataSource()
'    Set FrmName = Me
'    BindControls rsHeader
'    Set dtgList.DataSource = rsHeader
'    Set dtgDR.DataSource = rsDetail
'    Set txtLongDesc.DataSource = rsDetail
'End Sub
'
''Sets the data field for every bounded controls
'Sub SetDataField()
'    With rsHeader
'        txtDRNo.DataField = !cdrno
'        dtbDate.DataField = !dDate
'        dtbReceived.DataField = !dReceived
'        dtbReturned.DataField = !dReturned
'        txtType.DataField = !cType
'        txtDocType.DataField = !cdoctype
'        txtDelCode.DataField = !cDelCode
'        txtPCCode.DataField = !cPCCode
'        txtRemarks.DataField = !cRemarks
'        txtProjNo.DataField = !cProjNo
'        txtGross.DataField = !nGross
'        txtInvNo.DataField = !cInvNo
'    End With
'End Sub
'
'
'Private Sub rsHeader_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
'On Error GoTo ErrorHandler
'
'    If Not (rsHeader.EOF) Or Not (rsHeader.BOF) Then
'        'Status bar setup
'        sbRS.Panels(1) = "Record: " & IIf((rsHeader.AbsolutePosition = -2), "0", rsHeader.AbsolutePosition) & "/" & rsHeader.RecordCount
'
'        If rsHeader.Status <> adRecNew Then
'            txtDRNo.Locked = True
'        Else
'            txtDRNo.Locked = False
'        End If
'
'        If Mode = AddNewEdit Then
'            Select Case rsHeader.Status
'                Case adRecNew
'                    sbRS.Panels(2) = "New"
'                Case adRecModified
'                    sbRS.Panels(2) = "Modified"
'                Case Else
'                    sbRS.Panels(2) = ""
'            End Select
'        Else
'            sbRS.Panels(2) = ""
'        End If
'
'        GetChild
'
'        If rsHeader!lCancelled = True Then
'            sbRS.Panels(5) = "CANCELLED"
'        Else
'            sbRS.Panels(5) = ""
'        End If
'    Else
'        sbRS.Panels(1) = "Record: 0/0"
'        sbRS.Panels(2) = ""
'        txtDRNo.Locked = False
'    End If
'
'    If Mode = AddNewEdit Then
'        dtgDR.Refresh
'    End If
'
'ErrorHandler:
'    'Err.Number -2147217885
'    'Description - Row handle referred to a deleted row or a row marked for deletion.
'    If Err.Number = -2147217885 Then
'        Resume Next
'    End If
'
'End Sub
'
'Private Sub Timer1_Timer()
'    If Mode = AddNewEdit Then
'        SSTab1.TabEnabled(1) = False
'    Else
'        SSTab1.TabEnabled(1) = True
'    End If
'
'    If Mode <> Find Then Exit Sub
'    If txtDRNo.BackColor = &HE0FFFF Then
'        txtDRNo.BackColor = &HE0E0E0
'        Exit Sub
'    End If
'    If txtDRNo.BackColor <> &HE0FFFF Then
'        txtDRNo.BackColor = &HE0FFFF
'        Exit Sub
'    End If
'End Sub
'
'Private Sub txtDelCode_Change()
'    txtDelName = ""
'    txtDelName = GetValueFrTable("cName", "CLIENT", "cCode = '" & Trim(txtDelCode) & "'")
'    If Mode <> AddNewEdit Then Exit Sub
'    If rsHeader.Status <> adRecNew Then Exit Sub
'    If txtDelName <> "" Then
'        If (UCase(Trim(cboType)) = "ISSUES") Or (UCase(Trim(cboType)) = "SALES") Then DRCreditLimitOK
'    End If
'End Sub
'
'Private Sub txtDelCode_LostFocus()
'    If Mode <> AddNewEdit Then Exit Sub
'    If Trim(txtDelName) = "" And Trim(txtDelCode) <> "" Then cmdPickDelCode_Click
'End Sub
'
'Private Sub txtDocType_Change()
'    If Trim(txtDocType) <> "" Or txtDocType <> vbNullString Then
'        cboDocType = Trim(txtDocType)
'    Else
'        cboDocType.ListIndex = -1
'    End If
'End Sub
'
'Private Sub txtLongDesc_KeyPress(KeyAscii As Integer)
'    If Mode <> AddNewEdit Then Exit Sub
'    If KeyAscii = 39 Then KeyAscii = 0 'Apostrophe {'}
'    KeyAscii = Asc(UCase(Chr(KeyAscii)))
'End Sub
'
'Private Sub txtLongDesc_LostFocus()
'    txtLongDesc.Visible = False
'    dtgDR.Col = 3
'    dtgDR.SetFocus
'End Sub
'
'Private Sub txtDRNo_KeyDown(KeyCode As Integer, Shift As Integer)
'    If KeyCode = 13 Then
'        'Find
'        If Mode = Find Then
'
'            FormWaitShow App.Path & "\Transmit.avi", "Loading data . . ."
'
'            OpenNewConnection connHeader
'            OpenNewConnection connDetail
'
'            Set rsHeader = Nothing
'            Set rsDetail = Nothing
'            Set rsHeader = New ADODB.Recordset
'            Set rsDetail = New ADODB.Recordset
'
'            If Trim(txtDRNo) = "" Then
'                OpenRecordsetWithCN rsDetail, "*", "DR_T", connDetail
'                OpenRecordsetWithCN rsHeader, "*", "DR", connHeader
'            Else
'                OpenRecordsetWithCN rsDetail, "*", "DR_T", connDetail, "WHERE cDRNo LIKE '" & Trim(txtDRNo) & "%'"
'                OpenRecordsetWithCN rsHeader, "*", "DR", connHeader, "WHERE cDRNo LIKE '" & Trim(txtDRNo) & "%'"
'            End If
'
'            Set FrmName = Me
'            FormLocking True
'
'            If rsHeader.RecordCount = 0 Then
'                FormWaitHide
'                MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
'                rsHeader.Close
'                rsDetail.Close
'                BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
'                txtDRNo.Locked = False
'                txtDRNo.SetFocus
'                Exit Sub
'            End If
'
'            SetDataSource
'            SetDataField
'
'            txtDRNo.BackColor = &HE0FFFF
'            Mode = Normal
'
'            BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , lACCancel, , , True, True, lACPrint, True, True
'
'            FormWaitHide
'        End If
'    End If
'End Sub
'
'Private Sub txtDRNo_LostFocus()
'    'Does Code Already Exist
'    If Mode = AddNewEdit Then
'        If Trim(txtDRNo) = "" Then
'            MsgBox "Empty primary input.", vbInformation, "ComUnion"
'            txtDRNo.SetFocus
'        Else
'            If rsHeader.Status <> adRecNew Then Exit Sub
'            txtDRNo = Trim(txtDRNo)
'            If IDExisting(rsHeader, "cDRNo", "DR", Trim(rsHeader!cdrno)) Then
'                MsgBox "Delivery receipt No. already exist.", vbInformation, "ComUnion"
'                txtDRNo.SetFocus
'            End If
'        End If
'    End If
'End Sub
'
'Private Sub txtPCCode_Change()
'    txtPCDesc = ""
'    txtPCDesc = GetValueFrTable("cDescription", "PROFITCENTER", "cPCCode = '" & Trim(txtPCCode) & "'")
'End Sub
'
'Private Sub txtpcCode_LostFocus()
'    If Mode <> AddNewEdit Then Exit Sub
'    If Trim(txtPCDesc) = "" And Trim(txtPCCode) <> "" Then cmdPickPC_Click
'End Sub
'
'Private Sub txtProjNo_LostFocus()
'    If Mode <> AddNewEdit Then Exit Sub
'    If GetValueFrTable("cProjNo", "PROJECT", "cProjNo = '" & Trim(txtProjNo) & "' AND cCode = '" & Trim(txtDelCode) & "'") = "" Then cmdPickProjNo_Click
'End Sub
'
'Private Sub txtType_Change()
'    If Trim(txtType) <> "" Or txtType <> vbNullString Then
'        cboType = Trim(txtType)
'    Else
'        cboType.ListIndex = -1
'    End If
'End Sub
'
''Check if all mandatory fields are complete
'Function MandatoryOK() As Boolean
'
'    MandatoryOK = True
'
'    If Trim(txtDRNo) = "" Then
'        MandatoryOK = False
'        MsgBox "Field 'Receipt Number' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
'        txtDRNo.SetFocus
'        Exit Function
'    End If
'
'    ComputeAmount
'    ComputeTotal
'
'    If UCase(Trim(cboType)) = "SALES" Then rsHeader!cInvNo = "DR-" & rsHeader!cdrno
'
'    If rsHeader.Status = adRecNew And lSystemGeneratedDR = False Then
'        If IDExisting(rsHeader, "cDRNo", "DR", Trim(rsHeader!cdrno)) Then
'            MandatoryOK = False
'            MsgBox "Delivery reciept No. already exist.", vbInformation, "ComUnion"
'            txtDRNo.SetFocus
'            Exit Function
'        End If
'    End If
'
'    'Required fields
'    If Trim(dtbDate.Text) = "__/__/____" Then
'        MandatoryOK = False
'        MsgBox "Field 'Transaction Date' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
'        dtbDate.SetFocus
'        Exit Function
'    ElseIf Trim(txtType) = "" Then
'        MandatoryOK = False
'        MsgBox "Field 'Type' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
'        cboType.SetFocus
'        Exit Function
'    ElseIf Trim(txtDelCode) = "" Then
'        MandatoryOK = False
'        MsgBox "Field 'Client' is mandatory. Null value is not allowed.", vbInformation, "ComUnion"
'        txtDelCode.SetFocus
'        Exit Function
'    End If
'
'    GetChild
'
'    'Transaction without details
'    If rsDetail.RecordCount = 0 Then
'        MandatoryOK = False
'        MsgBox "Cannot save transaction without details.", vbInformation, "ComUnion"
'        dtgDR.SetFocus
'        Exit Function
'    End If
'
'    If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
'    Do Until rsDetail.EOF
'        If rsDetail.Status = (adRecNew) Or rsDetail.Status = (adRecModified) Then
'            If IsNull(rsDetail!cItemNo) Then
'                rsDetail.Delete
'            ElseIf Trim(rsDetail!cItemNo) = "" Then
'                rsDetail.Delete
'            Else
'                rsDetail.MoveNext
'            End If
'        Else
'            rsDetail.MoveNext
'        End If
'    Loop
'
'    GetChild
'
'    If rsDetail.RecordCount < 1 Then
'        MsgBox "Cannot save transaction without details.", vbExclamation, "ComUnion"
'        MandatoryOK = False
'        Exit Function
'    End If
'
'End Function
'
''Filter detail recordset to header's primary
'Private Sub GetChild()
'    rsDetail.Filter = "cDRNo = '" & Trim(rsHeader!cdrno) & "'"
'End Sub
'
''Sets the form if record number is zero
'Private Sub RSZero()
'    sbRS.Panels(1) = "Record: 0/0"
'    sbRS.Panels(2) = ""
'    sbRS.Panels(4) = ""
'    sbRS.Panels(5) = ""
'
'    Set dtgDR.DataSource = Nothing
'    dtgDR.Refresh
'
'    Set FrmName = Me
'    UnbindControls
'    TextClearing
'    FormLocking True
'
'    If rsHeader.State = adStateOpen Then rsHeader.Close
'    If rsDetail.State = adStateOpen Then rsDetail.Close
'
'    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
'
'    txtDRNo.Locked = False
'    txtDRNo.SetFocus
'
'    Mode = Find
'
'End Sub
'
''Add DR Detals from picklist to details recordset
'Public Sub AddDetailsFromList()
'
'    GetChild
'
'    With frmARDRList.lvwList
'        For i = 1 To .ListItems.Count
'            If .ListItems(i).Checked = True Then
'                rsDetail.AddNew
'                rsDetail!cCompanyID = COID
'                rsDetail!cdrno = Trim(rsHeader!cdrno)
'                If Trim(cboType) = "Project" Then
'                    rsDetail!cRefNo = Trim(txtProjNo)
'                Else
'                    rsDetail!cRefNo = Trim(frmARDRList.mRefPK)
'                End If
'                rsDetail!cItemNo = IIf((Trim(.ListItems(i).Text) = "Other Item"), "", Trim(.ListItems(i).Text)) & "" 'Trim(.ListItems(i).Text)
'                rsDetail!cDesc = Trim(.ListItems(i).SubItems(1))
'                rsDetail!cWH = Trim(.ListItems(i).SubItems(2))
'                rsDetail!cUnit = Trim(.ListItems(i).SubItems(3))
'                rsDetail!nQty = CDbl(.ListItems(i).SubItems(4))
'                rsDetail!nPrice = CDbl(.ListItems(i).SubItems(5))
'                rsDetail!nAmount = CDbl(.ListItems(i).SubItems(6))
'                rsDetail!nRefIdentity = CDbl(.ListItems(i).SubItems(7))
'                rsDetail!cCosting = Trim(GetValueFrTable("cCosting", "ITEM", "cItemNo = '" & Trim(rsDetail!cItemNo) & "'")) & ""
'                'COSTING
'                rsDetail!nCost = IIf(GetValueFrTable("nAveCost", "ITEM", "cItemNo = '" & Trim(rsDetail!cItemNo) & "'") = "", 0, GetValueFrTable("nAveCost", "ITEM", "cItemNo = '" & Trim(rsDetail!cItemNo) & "'"))
'            End If
'        Next i
'    End With
'
'    GetChild
'
'    ComputeAmount
'    ComputeTotal
'
'End Sub
'
''Computes total amount per detail line
'Private Sub ComputeAmount()
'Dim nAmount As Double
'    If Mode <> AddNewEdit Then Exit Sub
'    If rsDetail.RecordCount = 0 Then Exit Sub
'    With dtgDR
'        nAmount = IIf(IsNull(.Columns(6).Value), 0, .Columns(6).Value) * _
'                    IIf(IsNull(.Columns(7).Value), 0, .Columns(7).Value)
'        .Columns(8).Text = Format(nAmount, "###,##0.#0")
'    End With
'End Sub
'
''Gross amount
'Public Sub ComputeTotal()
'Dim n As Double
'
'On Error Resume Next
'
'    If Mode <> AddNewEdit Then Exit Sub
'
'    n = 0
'    Set rs = New Recordset
'
'    Set rs = rsDetail.Clone
'    rs.Filter = "cDRNo = '" & Trim(rsHeader!cdrno) & "'"
'
'    rs.MoveFirst
'    Do Until rs.EOF
'        n = n + IIf(IsNull(rs!nAmount), 0, rs!nAmount)
'        rs.MoveNext
'    Loop
'
'    Set rs = Nothing
'
'    rsHeader!nGross = n
'
'End Sub
'
''Inserts into SALES & SALES_T tables
'Private Function DRSales() As Boolean
'Dim rsSales As New ADODB.Recordset
'Dim rsSales_T As New ADODB.Recordset
'Dim cSO, cSO_T As String
'Dim nSO_I As Long
'
'On Error GoTo DRSalesExit
'
'    DRSales = False
'
'    cString = "DR-" & Trim$(rsHeader!cdrno)
'    cSO = rsDetail!cRefNo
'    rsHeader!cInvNo = Trim(cString)
'
'    'FOR REVISION [DO NOT DELETE BECAUSE OF THE IDENTITY] ???????????
'    cn.Execute ("DELETE SALES_T WHERE cCompanyID = '" & COID & "' AND cInvNo = '" & Trim(cString) & "'")
'    cn.Execute ("DELETE SALES WHERE cCompanyID = '" & COID & "' AND cInvNo = '" & Trim(cString) & "'")
'
'    GetChild
'
'    OpenRecordset rsSales, "*", "SALES", "WHERE 1 = 0"
'    OpenRecordset rsSales_T, "*", "SALES_T", "WHERE 1 = 0"
'
'    With rsSales
'        .AddNew
'        !cCompanyID = COID
'        !cInvNo = Trim$(cString)
'        !dDate = rsHeader!dDate
'        !cType = "Invoice w/ DR"
'        !cCode = Trim(rsHeader!cDelCode)
'        !cMSCode = GetValueFrTable("cMSCode", "CLIENT_CUSTOMER", "cCode = '" & Trim(rsHeader!cDelCode) & "'")
'        !cPCCode = Trim(txtPCCode)
'        !cSMan = GetValueFrTable("cSMan", "CLIENT_CUSTOMER", "cCode = '" & Trim(rsHeader!cDelCode) & "'")
'        !cTerm = GetValueFrTable("cTerm", "SO", "cSONo = '" & Trim(cSO) & "'")
'        !cIntTerm = GetValueFrTable("cIntTerm", "SO", "cSONo = '" & Trim(cSO) & "'")
'        !cPayType = "Credit"
'        !nGross = rsHeader!nGross
'        !nBalance = rsHeader!nGross
'    End With
'
'    Do While Not rsDetail.EOF
'        With rsSales_T
'            .AddNew
'            !cCompanyID = COID
'            !cInvNo = Trim$(cString)
'            !cRefNo = Trim$(rsHeader!cdrno)
'            !nRefIdentity = rsDetail!nIdentity
'            !cWH = Trim$(rsDetail!cWH)
'            !cItemNo = Trim$(rsDetail!cItemNo)
'            !cDesc = Trim$(rsDetail!cDesc)
'            !cUnit = Trim$(rsDetail!cUnit)
'            !nQty = rsDetail!nQty
'            !nPrice = rsDetail!nPrice
'            !nAmount = rsDetail!nAmount
'            !nCost = rsDetail!nCost
'            !cCosting = rsDetail!cCosting
'
'            cSO_T = rsDetail!cRefNo
'            nSO_I = rsDetail!nRefIdentity
'            !cPricing = GetValueFrTable("cPricing", "SO_T", "cSONo = '" & Trim(cSO) & "' AND nIdentity = '" & nSO_I & "'")
'            !nUDPrice = GetValueFrTable("nPrice", "SO_T", "cSONo = '" & Trim(cSO) & "' AND nIdentity = '" & nSO_I & "'")
'            !cDiscount = GetValueFrTable("cDiscount", "SO_T", "cSONo = '" & Trim(cSO) & "' AND nIdentity = '" & nSO_I & "'")
'            !nTPC = GetValueFrTable("nTPC", "SO_T", "cSONo = '" & Trim(cSO) & "' AND nIdentity = '" & nSO_I & "'")
'            !nSMCom = GetValueFrTable("nSMCom", "SO_T", "cSONo = '" & Trim(cSO) & "' AND nIdentity = '" & nSO_I & "'")
'        End With
'        rsDetail.MoveNext
'    Loop
'
'    rsSales.UpdateBatch adAffectAll
'    rsSales_T.UpdateBatch adAffectAll
'
'    Set rsSales = Nothing
'    Set rsSales_T = Nothing
'
'    DRSales = True
'
'DRSalesExit:
'    Exit Function
'
'End Function
'
''Update reference number in Production_FG table (Production-Int & Production-OS)
'Sub Update_Prod_RefNo(DRNo As String)
'Dim RefPONo As String
'
'    GetChild
'    If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
'    Do Until rsDetail.EOF
'        RefPONo = rsDetail!cRefNo
'
'        cn.Execute "UPDATE PRODUCTION SET lRRReady = 1, cDRNo = '" & DRNo & "' WHERE cTranNo = '" & Trim(RefPONo) & "' " & _
'                    "AND cCompanyID = '" & COID & "'"
'
'        rsDetail.MoveNext
'    Loop
'
'End Sub
'
'Private Function AllowEdit() As Boolean
'    AllowEdit = True
'
'    If UCase(Trim(cboType)) = "CONSIGNMENT" Then
'        sSQL = "SELECT A.cRefNo FROM WRR_T A " & _
'                "LEFT OUTER JOIN WRR B ON A.cCompanyID = B.cCompanyID AND A.cWRRNo = B.cWRRNo " & _
'                "WHERE B.cType = 'Consignment' AND A.cRefNo = '" & Trim(txtDRNo) & "' AND A.cCompanyID = '" & COID & "'"
'        Set rs = New Recordset
'        rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
'        If rs.RecordCount > 0 Then
'            MsgBox "Cannot edit transaction with receiving report.", vbCritical + vbExclamation, "ComUnion"
'            AllowEdit = False
'        End If
'        Set rs = Nothing
'        Exit Function
'    ElseIf UCase(Trim(cboType)) = "TRANSFER" Then
'        sSQL = "SELECT A.cRefNo FROM WRR_T A " & _
'                "LEFT OUTER JOIN WRR B ON A.cCompanyID = B.cCompanyID AND A.cWRRNo = B.cWRRNo " & _
'                "WHERE B.cType = 'Transfer' AND A.cRefNo = '" & Trim(txtDRNo) & "' AND A.cCompanyID = '" & COID & "'"
'        Set rs = New Recordset
'        rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
'        If rs.RecordCount > 0 Then
'            MsgBox "Cannot edit transaction with receiving report.", vbCritical + vbExclamation, "ComUnion"
'            AllowEdit = False
'        End If
'        Set rs = Nothing
'        Exit Function
'    'Cannot edit if transaction already has a collection reference
'    ElseIf GetValueFrTable("cInvNo", "PR_T", "cInvNo = '" & Trim(rsHeader!cInvNo) & "'") <> "" Then
'        MsgBox "Cannot edit transaction with invoice/collection.", vbCritical + vbExclamation, "ComUnion"
'        AllowEdit = False
'        Exit Function
'    End If
'
'    'Cannot edit if transaction already has an invoice reference
'    If Trim(txtInvNo) <> "" Then
'        MsgBox "Cannot edit transaction with invoice.", vbCritical + vbExclamation, "ComUnion"
'        AllowEdit = False
'        Exit Function
'    End If
'
'End Function
'
'Private Function AllowDelete(sAction As String) As Boolean
'    AllowDelete = True
'
'    If UCase(Trim(cboType)) = "CONSIGNMENT" Then
'        sSQL = "SELECT A.cRefNo FROM WRR_T A " & _
'                "LEFT OUTER JOIN WRR B ON A.cCompanyID = B.cCompanyID AND A.cWRRNo = B.cWRRNo " & _
'                "WHERE B.cType = 'Consignment' AND A.cRefNo = '" & Trim(txtDRNo) & "' AND A.cCompanyID = '" & COID & "'"
'        Set rs = New Recordset
'        rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
'        If rs.RecordCount > 0 Then
'            MsgBox "Cannot " & sAction & " transaction with receiving report.", vbCritical + vbExclamation, "ComUnion"
'            AllowDelete = False
'        End If
'        Set rs = Nothing
'        Exit Function
'    ElseIf UCase(Trim(cboType)) = "TRANSFER" Then
'        sSQL = "SELECT A.cRefNo FROM WRR_T A " & _
'                "LEFT OUTER JOIN WRR B ON A.cCompanyID = B.cCompanyID AND A.cWRRNo = B.cWRRNo " & _
'                "WHERE B.cType = 'Transfer' AND A.cRefNo = '" & Trim(txtDRNo) & "' AND A.cCompanyID = '" & COID & "'"
'        Set rs = New Recordset
'        rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
'        If rs.RecordCount > 0 Then
'            MsgBox "Cannot " & sAction & " transaction with receiving report.", vbCritical + vbExclamation, "ComUnion"
'            AllowDelete = False
'        End If
'        Set rs = Nothing
'        Exit Function
'    'Cannot delete if transaction already has a collection reference
'    ElseIf GetValueFrTable("cInvNo", "PR_T", "cInvNo = '" & Trim(rsHeader!cInvNo) & "'") <> "" Then
'        MsgBox "Cannot " & sAction & " transaction with invoice/collection.", vbCritical + vbExclamation, "ComUnion"
'        AllowDelete = False
'        Exit Function
'    End If
'
'    'Delete existing reference sales invoice for this transaction
'    If UCase(Trim(cboType)) = "SALES" Then
'        If MsgBox("Transaction type is 'DR Sales'. Reference sales invoice for this transaction will also be deleted. Proceed anyway?", vbCritical + vbOKCancel, "ComUnion") = vbCancel Then
'            AllowDelete = False
'            Exit Function
'        End If
'        If Trim(txtInvNo) <> "" Then
'            cn.Execute ("DELETE SALES_T WHERE cInvNo = '" & Trim$(rsHeader!cInvNo) & "' AND cCompanyID = '" & COID & "'")
'            cn.Execute ("DELETE SALES WHERE cInvNo = '" & Trim$(rsHeader!cInvNo) & "' AND cCompanyID = '" & COID & "'")
'        End If
'    ElseIf UCase(Trim(cboType)) = "PRODUCTION-INT" Then
'        cn.Execute ("UPDATE PRODUCTION SET cDRNo = NULL, lRRReady = 0 WHERE cDRNo = '" & Trim$(rsHeader!cdrno) & "' AND cCompanyID = '" & COID & "'")
'    ElseIf UCase(Trim(cboType)) = "PRODUCTION-OS" Then
'        cn.Execute ("UPDATE PRODUCTION SET cDRNo = NULL, lRRReady = 0 WHERE cDRNo = '" & Trim$(rsHeader!cdrno) & "' AND cCompanyID = '" & COID & "'")
'    ElseIf Trim(txtInvNo) <> "" Then
'        If MsgBox("Transaction already has an invoice. Reference sales invoice for this transaction will also be deleted. Proceed anyway?", vbCritical + vbOKCancel, "ComUnion") = vbCancel Then
'            AllowDelete = False
'            Exit Function
'        End If
'        cn.Execute ("DELETE SALES_T WHERE cInvNo = '" & Trim$(rsHeader!cInvNo) & "' AND cCompanyID = '" & COID & "'")
'        cn.Execute ("DELETE SALES WHERE cInvNo = '" & Trim$(rsHeader!cInvNo) & "' AND cCompanyID = '" & COID & "'")
'    End If
'
'End Function
'
'Sub EditDetail(bval As Boolean)
'
'    If UCase$(Trim$(cboType)) = "REPLACEMENT" Then
'        dtgDR.Columns(6).Locked = bval
'    Else
'        dtgDR.Columns(6).Locked = Not bval
'    End If
'
'    If UCase$(Trim$(cboType)) = "SALES" Then
'        dtgDR.Columns(7).Locked = Not bval
'    ElseIf UCase$(Trim$(cboType)) = "TRANSFER" Then
'        dtgDR.Columns(7).Locked = Not bval
'    Else
'        dtgDR.Columns(7).Locked = bval
'    End If
'
'End Sub
'
''Checks the credit status of the client
'Function DRCreditLimitOK() As Boolean
'Dim sCode, sPCCode As String
'Dim lCHold As Boolean
'
'    If Not GetValueFrTable("lBit", "SYSTEM_OPTION", "cCode = 'CL_CHECKING_DR'") Then
'        DRCreditLimitOK = True
'        Exit Function
'    End If
'
'    MousePointer = vbHourglass
'    FormWaitShow App.Path & "\Transmit.avi", "Checking Credit Limit Balance . . ."
'
'    sCode = Trim(txtDelCode)
'
'    cn.CommandTimeout = 600
'    If Not GetValueFrTable("lGroupLimit", "CLIENT_CUSTOMER", "cCode = '" & sCode & "'") Then
'        'Query for independent client
'        sSQL = "SELECT cCompanyID, cCode, SUM(nLimit) AS nLimit, SUM(nAR) AS nAR, SUM(nARPastDue) AS nARPastDue, " & _
'                "SUM(nPDC) AS nPDC, SUM(CAST(lHold AS INT)) AS nHold, SUM(nBounced) AS nBounced, " & _
'                "SUM(nSOAmtLeft) AS nSOAmtLeft, SUM(nLimitBalance) AS nLimitBalance " & _
'                "From V_CG " & _
'                "WHERE cCode = '" & sCode & "' AND cCompanyID = '" & COID & "'" & _
'                "GROUP BY cCompanyID, cCode"
'    Else
'        sPCCode = GetValueFrTable("cGroupCode", "CLIENT_CUSTOMER", "cCode = '" & sCode & "'")
'        lCHold = GetValueFrTable("lHold", "CLIENT_CUSTOMER", "cCode = '" & sCode & "'")
'        'Query for customer affecting parent company
'        sSQL = "SELECT cCompanyID, cGroupCode, SUM(nLimit) AS nLimit, SUM(nAR) AS nAR, SUM(nARPastDue) AS nARPastDue, " & _
'                "SUM(nPDC) AS nPDC, " & IIf(lCHold, "1", "0") & " AS nHold, SUM(nBounced) AS nBounced, " & _
'                "SUM(nSOAmtLeft) AS nSOAmtLeft, SUM(nLimit - nAR - nPDC - nSOAmtLeft) AS nLimitBalance " & _
'                "From V_CG_PC " & _
'                "WHERE cGroupCode = '" & sPCCode & "' AND cCompanyID = '" & COID & "'" & _
'                "GROUP BY cCompanyID, cGroupCode"
'    End If
'
'    Set rs = New Recordset
'    rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
'    cn.CommandTimeout = 120
'
'    If rs.RecordCount > 0 Then
'        nLimit = rs!nLimit
'        nAR = rs!nAR
'        nARPastDue = rs!nARPastDue
'        nPDC = rs!nPDC
'        nHold = rs!nHold
'        nBounced = rs!nBounced
'        nSOAmtLeft = rs!nSOAmtLeft
'        nLimitBalance = rs!nLimitBalance
'    Else
'        nLimit = 0
'        nAR = 0
'        nARPastDue = 0
'        nPDC = 0
'        nHold = 0
'        nBounced = 0
'        nSOAmtLeft = 0
'        nLimitBalance = 0
'    End If
'
'    'Is Credit OK?
'    Dim cHold, cOCL, cPDAR, cRTC As String
'
'    DRCreditLimitOK = True
'    If nHold > 0 Then
'        cHold = "Customer on Hold"
'        DRCreditLimitOK = False
'    End If
'    If nLimitBalance < 0 Then
'        cOCL = "Over Credit Limit [Php " & Format((-1 * nLimitBalance), "#,##0.#0") & "]"
'        DRCreditLimitOK = False
'    End If
'    If nARPastDue > 0 Then
'        cPDAR = "With Past Due A/R [Php " & Format(nARPastDue, "#,##0.#0") & "]"
'        DRCreditLimitOK = False
'    End If
'    If nBounced > 0 Then
'        cRTC = "With Bounced Check"
'        DRCreditLimitOK = False
'    End If
'
'    FormWaitHide
'    MousePointer = vbDefault
'
'    lOverride = False
'
'    If Not DRCreditLimitOK Then
'        MsgBox "Cannot proceed transaction with supplier " & sCode & " due to following reason/s:" & vbCr & _
'               cHold & IIf((cOCL <> ""), " | " & cOCL, "") & _
'               IIf((cPDAR <> ""), " | " & cPDAR, "") & _
'               IIf((cRTC <> ""), " | " & cRTC, ""), vbCritical, Me.Caption
'        If nBounced = 0 Then
'            RepName = Trim(txtDRNo)
'            frmOverride.mOverridingType = O_DR
'            frmOverride.Show vbModal
'            If gAction = G_OK Then
'                cmdPickDelCode.SetFocus
'                lOverride = True
'                Exit Function
'            Else
'                txtDelCode = ""
'                txtDelCode.SetFocus
'            End If
'        Else
'            txtDelCode = ""
'            txtDelCode.SetFocus
'        End If
'    End If
'
'End Function
'
''Item Balance per warehouse
'Function BalancePerWarehouseOK() As Boolean
'
'    Set rs = New Recordset
'
'    BalancePerWarehouseOK = True
'
'    If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
'    Do Until rsDetail.EOF
'        If rsDetail.Status = (adRecNew) Or rsDetail.Status = (adRecModified) Then
'            If IsNull(rsDetail!cItemNo) Then
'                rsDetail.Delete
'            ElseIf Trim(rsDetail!cItemNo) = "" Then
'                rsDetail.Delete
'            Else
'                rsDetail.MoveNext
'            End If
'        Else
'            rsDetail.MoveNext
'        End If
'    Loop
'
'    GetChild
'
'    cString = Empty
'
'    rsDetail.MoveFirst
'    Do Until rsDetail.EOF
'        sSQL = "SELECT (ISNULL(B.nInitial, 0) + A.nIncoming - A.nOutgoing + A.nRetSales - A.nRetPur - A.nIssues + " & _
'                "A.nBack - A.nProdOut + A.nProdIn + A.nAdjustment - A.nSampleDemo) AS nBalance " & _
'                "FROM V_ProductBalanceInquiry_WH A " & _
'                "FULL OUTER JOIN ITEM_W B ON A.cCompanyID = B.cCompanyID AND A.cItemNo = B.cItemNo AND A.cWH = B.cWH " & _
'                "WHERE A.cItemNo = '" & rsDetail!cItemNo & "' AND A.cCompanyID = '" & COID & "' AND A.cWH = '" & rsDetail!cWH & "' " & _
'                "GROUP BY A.cCompanyID, A.cItemNo, A.cWH, A.nIncoming, A.nOutgoing, A.nRetSales, A.nRetPur, A.nIssues, A.nBack, A.nProdOut, " & _
'                "A.nProdIn , A.nReserved, A.nAdjustment, A.nSampleDemo, B.nInitial"
'        rs.Open sSQL, cn, adOpenForwardOnly, adLockReadOnly
'        If rs.RecordCount > 0 Then
'            If rs!nBalance < rsDetail!nQty Then
'                cString = cString & vbCr & rsDetail!cItemNo & " WH: " & rsDetail!cWH & " Bal: " & Format(rs!nBalance, " #,##0.#0") & " Qty: " & Format(rsDetail!nQty, " #,##0.#0")
'            End If
'        Else
'            cString = cString & vbCr & rsDetail!cItemNo & " WH: " & rsDetail!cWH & " Bal: 0.00 Qty: " & Format(rsDetail!nQty, " #,##0.#0")
'        End If
'        rs.Close
'        rsDetail.MoveNext
'    Loop
'
'    Set rs = Nothing
'
'    If Trim(cString) <> "" Then
'        If MsgBox("Product balance per warehouse alert!" & vbCr & cString & vbCr & vbCr & _
'                "Do you want to proceeed on saving this transaction?", vbYesNo + vbInformation, "iTG Finace Manager") = vbNo Then BalancePerWarehouseOK = False
'    End If
'
'    rsDetail.MoveFirst
'    cString = Empty
'
'End Function
'
''Gets initital item values
'Private Sub GetInitialItemValues(RefRS As Recordset)
'    RefRS!cDesc = Trim(GetValueFrTable("cDesc", "ITEM", "cItemNo = '" & Trim(RefRS!cItemNo) & "'")) & ""
'    RefRS!cUnit = Trim(GetValueFrTable("cUnit", "ITEM", "cItemNo = '" & Trim(RefRS!cItemNo) & "'")) & ""
'    RefRS!cWH = Trim(GetValueFrTable("cWH", "ITEM", "cItemNo = '" & Trim(RefRS!cItemNo) & "'")) & ""
'    RefRS!nPrice = Trim(GetValueFrTable("nSRPrice", "ITEM", "cItemNo = '" & Trim(RefRS!cItemNo) & "'")) & ""
'    RefRS!nCost = IIf(GetValueFrTable("nAveCost", "ITEM", "cItemNo = '" & Trim(RefRS!cItemNo) & "'") = "", 0, GetValueFrTable("nAveCost", "ITEM", "cItemNo = '" & Trim(RefRS!cItemNo) & "'"))
'    RefRS!nQty = 0
'End Sub
'
'Sub GetCtrlNo()
''Dim sType As String
'Dim lCtrlNoOK As Boolean
'
'    If GetValueFrTable("lFormat", "PARAMETER_USER", "cValue = '" & Trim(cboDocType) & "' AND cType = 'DRDOCTYPE' ") <> True Then Exit Sub
'
'    strNo = Trim(GetValueFrTable("cSeries", "PARAMETER_USER", "cValue = '" & Trim(cboDocType) & "' AND cType = 'DRDOCTYPE' "))
'
'    X = ""
'    For i = 1 To Trim(GetValueFrTable("nPlaces", "PARAMETER_USER", "cValue = '" & Trim(cboDocType) & "' AND cType = 'DRDOCTYPE' ")) - Len(Trim(GetValueFrTable("cSeries", "PARAMETER_USER", "cValue = '" & Trim(cboDocType) & "' AND cType = 'DRDOCTYPE' ")))
'        X = "0" + X
'    Next i
'
'    Do Until lCtrlNoOK
'        If IDExisting(rsHeader, "cDRNo", "DR", Left(strNo, 5) + Format(CStr((CInt(Right(strNo, 4)) + 1)), X)) Then
'            strNo = Left(strNo, 5) + Format(CStr((CInt(Right(strNo, 4)) + 1)), X)
'            'strNo = Left(strNo, 5) + Format(CStr((CInt(Right(strNo, 4)) + 1)), "0000")
'        Else
'            lCtrlNoOK = True
'        End If
'    Loop
'
'    strNo = Trim(Int(strNo) + 1)
'    sType = Trim(GetValueFrTable("cPrefix", "PARAMETER_USER", "cValue = '" & Trim(cboDocType) & "' AND cType = 'DRDOCTYPE' "))
'    txtDRNo = sType + X + strNo
'End Sub
'
''Check system generated number before saving
'Function CheckCtrlNo() As Boolean
'Dim lCtrlNoOK As Boolean
'Dim strNewNo As String
'Dim strNewDRNo As String
'Dim sTrap
'
'On Error GoTo TheSource
'
'    CheckCtrlNo = False
'    lChangedTranNo = False
'
'    If IDExisting(rsHeader, "cDRNo", "DR", rsHeader!cdrno) Then
'        'strNewNo = Left(txtDRNo, 5) & (Format(Right(txtDRNo, 4) - 1, X))
'        strNewNo = sType + X + strNo
'
'        sTrap = Trim(GetValueFrTable("cSeries", "PARAMETER_USER", "cValue = '" & Trim(cboDocType) & "' AND cType = 'DRDOCTYPE' "))
'
'        Do Until lCtrlNoOK
'            If IDExisting(rsHeader, "cDRNo", "DR", Left(strNewNo, 5) + Format(CStr((CInt(Right(strNewNo, 4)) + 1)), X)) Then
'                strNewNo = Left(strNewNo, 5) + Format(CStr((CInt(Right(strNewNo, 4)) + 1)), X)
'            Else
'                lCtrlNoOK = True
'            End If
'        Loop
'
''        If Mid(strNewNo, 4, 2) <> Format(Date, "yy") Then
''            strNewDRNo = Format(1, X)
''            strNewNo = "DR-" + Format(Date, "yy") + "0000"
''        Else
''            strNewDRNo = Format(Right(strNewNo, 4) + 1, "0000")
''        End If
''        strNewDRNo = "DR-" + Format(Date, "yy") + Trim(strNewDRNo)
'
'        'strNewDRNo = Format(Right(strNewNo, 4) + 1, X)
'        strNewDRNo = strNewNo
'
'        GetChild
'
'        rsHeader!cdrno = strNewDRNo
'        If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
'        Do Until rsDetail.EOF
'            rsDetail!cdrno = strNewDRNo
'            rsDetail.MoveNext
'        Loop
'
'        GetChild
'
'        strNo = Trim(Int(sTrap) + 1)
'    End If
'
'    CheckCtrlNo = True
'
'TheSource:
'    If Not CheckCtrlNo Then
'        If MsgBox("Record cannot be updated. Transaction number already exists. " & vbCr & _
'                "Current transaction number may have been used by other user/s since last read." & vbCr & _
'                "Do you want to assign another number?", vbYesNo + vbInformation, "ComUnion") = vbYes Then
'            frmChangeTranNo.mType = Change_DRNo
'            frmChangeTranNo.Show vbModal
'        Else
'            MsgBox "Transaction will be undone.", vbInformation, "ComUnion"
'            TBUndoAll
'        End If
'    Else
'        lChangedTranNo = True
'    End If
'End Function
'
''Update system generated number
'Sub UpdateCtrlNo()
'On Error GoTo TheSource
'
'    If GetValueFrTable("lFormat", "PARAMETER_USER", "cValue = '" & Trim(cboDocType) & "' AND cType = 'DRDOCTYPE' ") <> True Then Exit Sub
'
'    If Not lChangedTranNo Then
'        sSQL = "UPDATE PARAMETER_USER SET cSeries = '" & Trim(strNo) & "' WHERE cValue = '" & Trim(cboDocType) & "' AND cType = 'DRDOCTYPE' AND cCompanyID = '" & COID & "'"
'        cn.Execute sSQL
'    End If
'
'TheSource:
'    Exit Sub
'End Sub
'
'
''Change Transaction Number
'Sub ChangeTranNo(strTranNo As String)
'    GetChild
'
'    rsHeader!cdrno = strTranNo
'    If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
'    Do Until rsDetail.EOF
'        rsDetail!cdrno = strTranNo
'        rsDetail.MoveNext
'    Loop
'
'    GetChild
'End Sub
'
Private Sub Form_Load()

End Sub
